﻿<%@ Control Language="C#" AutoEventWireup="true" Codebehind="DistributedList.ascx.cs"
    Inherits="NCS.Module.CMS.Admin.WorkFlow.DistributedList" %>
<%@ Register Src="../UserControls/SelectDate.ascx" TagName="SelectDate" TagPrefix="uc1" %>
<%@ Register Assembly="NCS.Library" Namespace="NCS.Library.Controls" TagPrefix="cc1" %>
<%@ Register Assembly="System.Web.Extensions" Namespace="System.Web.UI" TagPrefix="asp" %>
<asp:UpdatePanel ID="uppanelDistribution" runat="server" UpdateMode="Conditional"
    RenderMode="Inline">
    <triggers>
        <asp:AsyncPostBackTrigger ControlID="dropZones" EventName="SelectedIndexChanged" />
        <asp:AsyncPostBackTrigger ControlID="dtgDeployList" EventName="RowCommand" />
    </triggers>
    <contenttemplate>
    <table border="0" cellpadding="0" cellspacing="0">
    <tr>
        <td>
            <asp:Button ID="btnAddtoEvent2" runat="server" Text="Thêm vào sự kiện" Visible="false"
                CssClass="Button" OnClick="btnAddtoEvent_Click" /></td>
    </tr>
</table>
<table id="Table1" cellspacing="0" cellpadding="3" width="100%">
    <tbody>
        <tr>
            <td colspan="2">
                <table cellspacing="2" cellpadding="2" width="100%">
                    <tbody>
                        <tr>
                            <td>
                                <b>Chuyên mục</b></td>
                            <td>
                                <asp:DropDownList ID="dropZones" runat="server" Width="480px" AutoPostBack="False">
                                </asp:DropDownList></td>
                        </tr>
                        <tr>
                            <td >
                                Từ khóa tìm kiếm&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
                                <td>
                                <asp:TextBox ID="txtkeysearch" runat="server" Width="395px"></asp:TextBox></td>
                        </tr>
                        <tr>
                            <td style="height: 10px" colspan="2">
                            </td>
                        </tr>
                        <tr>
                            <td align="right">
                            </td>
                            <td>
                                <strong>Loại bài :</strong>
                                <asp:RadioButtonList ID="rdoContentRanks" runat="server" CellSpacing="5" CellPadding="5"
                                    RepeatLayout="Flow" RepeatDirection="Horizontal">
                                    <asp:ListItem Value="0" Selected="True">Tất cả&nbsp;&nbsp;</asp:ListItem>
                                    <asp:ListItem Value="1">B&#236;nh thường&nbsp;&nbsp;</asp:ListItem>
                                    <%--<asp:ListItem Value="2">Ti&#234;u điểm&nbsp;&nbsp;</asp:ListItem>--%>
                                    <asp:ListItem Value="3">Nổi bật&nbsp;&nbsp;</asp:ListItem>
                                    <asp:ListItem Value="4">Tin chạy ngang&nbsp;&nbsp;</asp:ListItem>
                                    <%--<asp:ListItem Value="5">B&#234;n phải trang cấp 2</asp:ListItem>--%>
                                </asp:RadioButtonList><br />
                                <br />
                            </td>
                        </tr>
                        <tr>
                            <td style="height: 10px" colspan="2">
                            </td>
                        </tr>
                        <tr>
                            <td align="right">
                                từ ngày&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
                            <td>
                                <table cellspacing="0" cellpadding="0" border="0">
                                    <tbody>
                                        <tr>
                                            <td valign="top">
                                                <uc1:SelectDate ID="SelectDate1" runat="server"></uc1:SelectDate>
                                            </td>
                                            <td valign="top">
                                                &nbsp;đến ngày&nbsp;</td>
                                            <td valign="top">
                                                <uc1:SelectDate ID="SelectDate2" runat="server"></uc1:SelectDate>
                                            </td>
                                            <td style="padding-left: 20px">
                                                <asp:Button ID="btnSearch" OnClick="btnSearch_Click" runat="server" CssClass="Button"
                                                    Text="Tìm kiếm"></asp:Button></td>
                                        </tr>
                                    </tbody>
                                </table>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 100%" colspan="2">
                                <cc1:GridView ID="dtgDeployList" runat="server" Width="100%" CellPadding="2" CssClass="Grid"
                                    OnRowCommand="dtgDeployList_RowCommand" OnRowDataBound="dtgDeployList_RowDataBound"
                                    PageSize="15" BorderWidth="1px" BorderStyle="Solid" BorderColor="Gainsboro" AutoGenerateColumns="False"
                                    AllowPaging="True" VirtualItemCount="-1" AllowSorting="True">
                                    <PagerSettings Mode="NumericFirstLast"></PagerSettings>
                                    <RowStyle VerticalAlign="Middle" CssClass="Grid_Raw1" Height="60px"></RowStyle>
                                    <Columns>
                                        <asp:BoundField DataField="Content_ID" HeaderText="ID">
                                            <headerstyle width="1px"></headerstyle>
                                            <itemstyle width="1px"></itemstyle>
                                        </asp:BoundField>
                                       
                                        <asp:TemplateField>
                                            <itemtemplate>
									<asp:CheckBox id="chkCheck" runat="server"></asp:CheckBox>
								
</itemtemplate>
                                            <headerstyle width="50px" horizontalalign="Center"></headerstyle>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="T&#234;n b&#224;i">
                                            <itemtemplate>
									<asp:HyperLink ID="lnkHeadline" runat="server"></asp:HyperLink>
									<br />
									Người tạo: <b><asp:Literal runat="server" id="ltr_usercreate"></asp:Literal></b><br />
									Ngày tạo: <b><%# Eval("Content_CreateDate") %></b><br />
									Người cập nhật cuối: <b><asp:Literal runat="server" id="ltr_usermodify"></asp:Literal></b><br />
									Ngày cập nhật cuối: <b><%# Eval("Content_ModifiedDate") %></b><br />
									Số lượt đọc: <b><%# Eval("Distribution_View")%></b><br />
								
</itemtemplate>
                                            <headerstyle horizontalalign="Center"></headerstyle>
                                            <itemstyle width="400px"></itemstyle>
                                        </asp:TemplateField>

                                        <asp:BoundField DataField="Zone_Name" HeaderText="Vị trí hiện"><HeaderStyle Width="70px"></HeaderStyle></asp:BoundField>
                                       
                                        <asp:BoundField DataField="Distribution_View" HeaderText="Xem"><HeaderStyle Width="20px"></HeaderStyle></asp:BoundField>

                                        <asp:TemplateField HeaderText="Checkout by">
                                            <itemtemplate>
                                            <asp:HiddenField runat="server" id ="hddcurrent_zoneid"></asp:HiddenField>
								<asp:Label id=lblUserCheckOut runat=server></asp:Label>
						
</itemtemplate>
                                            <headerstyle horizontalalign="Center" width="90px"></headerstyle>
                                            <itemstyle width="90px"></itemstyle>
                                        </asp:TemplateField>
                                        <asp:TemplateField visible="false"> 
                                            <headertemplate>
								<%--	<asp:Button ID="cmdUpdateRank" runat="server" Width="80px" CommandName="updaterank"
										CssClass="Button" Text="Cập nhật" ></asp:Button>--%>
								
</headertemplate>
                                            <itemtemplate>
                        <asp:DropDownList id="dropContentRank" runat="server" Width="70px" Enable ="false">
								<asp:ListItem Value="1">B&#236;nh thường</asp:ListItem>
								<asp:ListItem Value="2">Ti&#234;u điểm</asp:ListItem>
								<asp:ListItem Value="3">Nổi bật</asp:ListItem>
							</asp:DropDownList>
									
								
</itemtemplate>
                                            <headerstyle horizontalalign="Center" width="80px"></headerstyle>
                                            <itemstyle horizontalalign="Center"></itemstyle>
                                        </asp:TemplateField>
                                        <asp:TemplateField>
                                            <headertemplate>
									<asp:Button ID="cmdUpdateIndex" runat="server" Width="60" CommandName="updatepriority"
										CssClass="Button" Text="Thứ tự"></asp:Button>
								
</headertemplate>
                                            <itemtemplate>
									<asp:DropDownList ID="dropIndex" runat="server" Width="60">
									</asp:DropDownList>
								
</itemtemplate>
                                            <headerstyle horizontalalign="Center" width="60px"></headerstyle>
                                            <itemstyle horizontalalign="Center"></itemstyle>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Thao t&#225;c">
                                            <itemtemplate>
                                            <asp:Panel runat="server" id="pn_cmdEdit">
                                              <input id="Button1" type="button" value="Sửa" class="Button" onclick="GoToURRL('<%# Eval("Content_ID") %>','<%#Eval("Distribution_zoneID") %>')" />
                                            </asp:Panel>
                                          
                                           
									<asp:Button ID="cmdRemove" runat="server" CssClass="Button" width=55px CommandName="remover"
										Text="Gỡ xuống" CommandArgument='<%# Eval("Content_ID") %>'></asp:Button>
								<%--	<asp:Button ID="cmdEdit" runat="server" CssClass="Button" CommandName="editcontent"
										Text="Sửa" CommandArgument='<%# Eval("Content_ID") %>'></asp:Button>--%>
									<asp:Button ID="cmdDel" runat="server" CssClass="Button" CommandName="deletecontent"
										Text="Xóa" CommandArgument='<%# Eval("Content_ID") %>'></asp:Button>
									<asp:Button ID="cmdrollback" runat="server"   CssClass="Button" width=45px CommandName="rollback"
										Text="Rollback" Tooltip="Sử dụng lại bài viết đã được đăng trước đó" CommandArgument='<%# Eval("Content_ID") %>'></asp:Button>
									<br /><div style="padding-top:6px">
									<asp:hyperlink runat="server" id="hplVersion" CssClass="page-options" Tooltip="Xem các phiên bản của bài viết này" params="lightwindow_type=external,lightwindow_width=800,lightwindow_height=350">Version</asp:hyperlink>
									<div style="display:none;">
									<asp:hyperlink runat=server id="hplComment" CssClass="page-options" Tooltip="Xem các phản hồi (feedback) của bài viết này" params="lightwindow_type=external,lightwindow_width=800,lightwindow_height=350"></asp:hyperlink>
									</div>

									
									</div>
</itemtemplate>
                                            <headerstyle horizontalalign="Center" width="200px"></headerstyle>
                                            <itemstyle horizontalalign="Center"></itemstyle>
                                        </asp:TemplateField>
                                        
                                           
                                    </Columns>
                                    <HeaderStyle CssClass="Grid_Top" Font-Bold="True"></HeaderStyle>
                                    <AlternatingRowStyle VerticalAlign="Middle" CssClass="Grid_Raw2" Height="60px"></AlternatingRowStyle>
                                </cc1:GridView>
                            </td>
                        </tr>
                        <tr>
                            <td style="height: 10px">
                            </td>
                        </tr>
                    </tbody>
                </table>
            </td>
        </tr>
    </tbody>
</table>
</contenttemplate>
</asp:UpdatePanel>
									<script language="javascript">
									function GoToURRL(contentid, zoneid)
									{
									    var url = '<%=Url_edit%>&contentid='+ contentid +'&inportalid=<%=Portal_ID %>&inzoneid='+ zoneid;
									   //alert(url);
									    window.location.href =     url;
									    //<a href="<%=Url_edit%>&contentid=<%# Eval("Content_ID") %>&inportalid=<%=Portal_ID %>&inzoneid=<%#Eval("Distribution_zoneID") %>">Sửa</a>
									}
									</script>
<table border="0" cellpadding="0" cellspacing="0">
    <tr>
        <td>
            <asp:Button ID="btnAddtoEvent" runat="server" Text="Thêm vào chuyên đề" Visible="false"
                CssClass="Button" OnClick="btnAddtoEvent_Click" /></td>
    </tr>
</table>


